<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ page session="true" %>
<%@ page pageEncoding="UTF-8" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<% 
	String bossUrl = com.appleframework.config.core.PropertyConfigurer.getValue("boss.url");
 %>
<html>
<head>
	<title>登录</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <meta name="renderer" content="webkit">
	<meta charset="utf-8" />
	<meta name="description" content="overview & stats" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		
	<!-- Bootstrap 封装样式表 当前版本 v3.3.5-->
	<link rel="stylesheet" href="css/bootstrap.min.css">
	<!--css动画-->
    <link rel="stylesheet" href="css/animate.css">
	<link rel="stylesheet" href="css/treeview-master/css/bootstrap-treeview.min.css">
	<link rel="stylesheet" href="css/layer/layim/layim.css">
	<link rel="stylesheet" href="css/snow.css">
	<link rel="stylesheet" href="css/template.css">
	<link rel="stylesheet" href="css/bootstrap-select.min.css">
	    
	<!-- 自定义样式表  注：自定义的样式表总是放在Bootstrap 封装样式表后面 -->
	<link rel="stylesheet" href="css/index.css">
	<link rel="stylesheet" href="css/data-management.css">
		
	<!--Bootstrap 封装jquery库js文件-->
	<script src="js/jquery.min.js"></script>
	<script src="js/bootstrap.min.js"></script>
	<script src="js/layer/layer.js"></script>
	
</head>
<body>

    <div class="col-md-4 login-form" style="text-align: center;">
        <div class="animated pulse">
            <div class="login">
                <div class="tabs-container">
                    <ul class="nav nav-tabs login-mode">
                        <li class="active"><a data-toggle="tab" href="#tab-A">运管平台用户登录</a></li>
                    </ul>
                    <div class="tab-content">
                        <div id="tab-A" class="tab-pane active">
                        	<form:form method="post" id="fm1" cssClass="fm-v clearfix login_form" commandName="${commandName}" htmlEscape="true">
                            <div class="panel-body">
                                <div class="form-signin-heading">
                                    <span class="glyphicon glyphicon-user"></span>
                                    <label class="sr-only" for="username">用户名</label>
                                    <c:if test="${not empty sessionScope.openIdLocalId}">
										<strong>${sessionScope.openIdLocalId}</strong>
										<input type="hidden" id="username" cssClass="form-control" maxlength="50" value="${sessionScope.openIdLocalId}" tabindex="1" />
									</c:if>
									<c:if test="${empty sessionScope.openIdLocalId}">
										<form:input id="username" path="username" cssClass="form-control" accesskey="${userNameAccessKey}"  autocomplete="false" htmlEscape="true" tabindex="1" value="${credentials.username}"  />
									</c:if>
									<form:errors path="*" id="msg" style="display:none;" cssClass="errors" element="span" />
                                </div>
                                <div class="form-signin-heading">
                                    <span class="glyphicon glyphicon-lock"></span>
                                    <label for="password" class="sr-only">密码</label>
                           			<form:password id="password" path="password" cssClass="form-control" accesskey="${passwordAccessKey}" autocomplete="off" htmlEscape="true" tabindex="2" size="25"   />
                                </div>
                                <div class="checkbox margin-t"></div>
                                
                           		<input type="hidden" name="lt" value="${loginTicket}" />
								<input type="hidden" name="execution" value="${flowExecutionKey}" />
								<input type="hidden" name="_eventId" value="submit" />                                
                                <button class="btn btn-lg btn-primary btn-block btn-login" type="button" id="login" onclick="logins();">登录</button>
                            </div>
                            </form:form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
<script type="text/javascript">

	var errorMsg = $("#msg").text();
	
	if (errorMsg !== null && errorMsg !== undefined && errorMsg !== '') { 
		layer.tips(errorMsg, '#username',{
      		tips: [3, '#ff3300'],
         	time: 3000
 		});
      	$("#username").focus();
	} 	

    //检索框添加回车查询操作
    document.onkeydown = function (e) {
        var theEvent = window.event || e;
        var code = theEvent.keyCode || theEvent.which;
        if (code == 13) {
            logins();
        }
    }
    function logins(){
        var name =  $("#username").val().trim();
        var password =  $("#password").val().trim();
        if(name==""){
            layer.tips('用户名不能为空', '#username',{
                tips: [3, '#ff3300'],
                time: 3000
            });
            $("#username").focus();
            return;
        }

        if(password==""){
            layer.tips('密码不能为空', '#password',{
                tips: [3, '#ff3300'],
                time: 3000
            });
            $("#password").focus();
            return;
        }

		$("#fm1").submit();
        
    }
</script>

</html>